//
//  DrawTableViewCell.m
//  lsOA
//
//  Created by 蓝水软件 on 16/7/14.
//  Copyright © 2016年 苏州蓝水有限公司. All rights reserved.
//

#import "DrawTableViewCell.h"

@implementation DrawTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    CGSize imageSize ;
    if (IS_IPHONE_4) {
        imageSize = CGSizeMake(20, 20);
    }else{
        imageSize = LRLCGSizeMake(20,20);
    }
    
    _imageView1 = [[UIImageView alloc]init];
    [self.contentView addSubview:_imageView1];

    [_imageView1 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self.contentView);
        make.left.mas_equalTo(20*FitSize);
        make.size.mas_equalTo(imageSize);
    }];
    
    _label = [[UILabel alloc]init];

    _label.textColor = [UIColor whiteColor];
    [self.contentView addSubview:_label];
    [_label mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self);
        make.left.equalTo(_imageView1.mas_right).offset(15);
        make.width.mas_equalTo(140*FitSize);
        make.height.mas_equalTo(30*FitSize);
    }];
    
    return self;


}

- (void)configWithDic:(NSDictionary *)dic indexPath:(NSInteger)Row{
    _imageView1.image = [UIImage imageNamed:dic[@"imageDataSource"][Row]];
    _label.text = dic[@"arrayDataSource"][Row];
    
}
@end
